<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: datatable   ColumnSet.js  (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">

	<div id="hd">
        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
        <h3>DataTable Widget&nbsp; <span class="subtitle">2.6.0</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_datatable.html">datatable</a>
                
                 &gt; ColumnSet.js (source view) 
            </p>


	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form name="yui-classopts-form">
    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> <label for="showprivate">Show Private</label></span>
    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
    <span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 #classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>

<span class="c">/**</span>
<span class="c"> * The ColumnSet class defines and manages a DataTable&#39;s Columns,</span>
<span class="c"> * including nested hierarchies and access to individual Column instances.</span>
<span class="c"> *</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @class ColumnSet</span>
<span class="c"> * @uses YAHOO.util.EventProvider</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param aDefinitions {Object[]} Array of object literals that define cells in</span>
<span class="c"> * the THEAD.</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnSet</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span> <span class="o">=</span> <span class="s2">&quot;yui-cs&quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnSet</span><span class="o">.</span><span class="nx">_nCount</span><span class="o">;</span>

    <span class="c">// First clone the defs</span>
<span class="c"></span>    <span class="nx">aDefinitions</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">_cloneObject</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">);</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_init</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">);</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnSet</span><span class="o">.</span><span class="nx">_nCount</span><span class="o">++;</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;ColumnSet initialized&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
<span class="o">};</span>

<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c">//</span>
<span class="c">// Private member variables</span>
<span class="c">//</span>
<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c"> * Internal class variable to index multiple ColumnSet instances.</span>
<span class="c"> *</span>
<span class="c"> * @property ColumnSet._nCount</span>
<span class="c"> * @type Number</span>
<span class="c"> * @private</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnSet</span><span class="o">.</span><span class="nx">_nCount</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnSet</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>
    <span class="c">/**</span>
<span class="c">     * Unique instance name.</span>
<span class="c">     *</span>
<span class="c">     * @property _sId</span>
<span class="c">     * @type String</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_sId</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Array of object literal Column definitions passed to the constructor.</span>
<span class="c">     *</span>
<span class="c">     * @property _aDefinitions</span>
<span class="c">     * @type Object[]</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_aDefinitions</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Public member variables</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Top-down tree representation of Column hierarchy.</span>
<span class="c">     *</span>
<span class="c">     * @property tree</span>
<span class="c">     * @type YAHOO.widget.Column[]</span>
<span class="c">     */</span>
    <span class="nx">tree</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Flattened representation of all Columns.</span>
<span class="c">     *</span>
<span class="c">     * @property flat</span>
<span class="c">     * @type YAHOO.widget.Column[]</span>
<span class="c">     * @default []</span>
<span class="c">     */</span>
    <span class="nx">flat</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Array of Columns that map one-to-one to a table column.</span>
<span class="c">     *</span>
<span class="c">     * @property keys</span>
<span class="c">     * @type YAHOO.widget.Column[]</span>
<span class="c">     * @default []</span>
<span class="c">     */</span>
    <span class="nx">keys</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * ID index of nested parent hierarchies for HEADERS accessibility attribute.</span>
<span class="c">     *</span>
<span class="c">     * @property headers</span>
<span class="c">     * @type String[]</span>
<span class="c">     * @default []</span>
<span class="c">     */</span>
    <span class="nx">headers</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Private methods</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Initializes ColumnSet instance with data from Column definitions.</span>
<span class="c">     *</span>
<span class="c">     * @method _init</span>
<span class="c">     * @param aDefinitions {Object[]} Array of object literals that define cells in</span>
<span class="c">     * the THEAD .</span>
<span class="c">     * @private</span>
<span class="c">     */</span>

    <span class="nx">_init</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">)</span> <span class="o">{</span>        
        <span class="c">// DOM tree representation of all Columns</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">tree</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="c">// Flat representation of all Columns</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">flat</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="c">// Flat representation of only Columns that are meant to display data</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">keys</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="c">// Array of HEADERS attribute values for all keys in the &quot;keys&quot; array</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">headers</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="c">// Tracks current node list depth being tracked</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">nodeDepth</span> <span class="o">=</span> <span class="o">-</span><span class="m">1</span><span class="o">;</span>

        <span class="c">// Internal recursive function to define Column instances</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">parseColumns</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">nodeList</span><span class="o">,</span> <span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// One level down</span>
<span class="c"></span>            <span class="nx">nodeDepth</span><span class="o">++;</span>

            <span class="c">// Create corresponding tree node if not already there for this depth</span>
<span class="c"></span>            <span class="k">if</span><span class="o">(!</span><span class="nx">tree</span><span class="o">[</span><span class="nx">nodeDepth</span><span class="o">])</span> <span class="o">{</span>
                <span class="nx">tree</span><span class="o">[</span><span class="nx">nodeDepth</span><span class="o">]</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="o">}</span>


            <span class="c">// Parse each node at this depth for attributes and any children</span>
<span class="c"></span>            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">j</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">nodeList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">currentNode</span> <span class="o">=</span> <span class="nx">nodeList</span><span class="o">[</span><span class="nx">j</span><span class="o">];</span>

                <span class="c">// Instantiate a new Column for each node</span>
<span class="c"></span>                <span class="k">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">);</span>
                
                <span class="c">// Cross-reference Column ID back to the original object literal definition</span>
<span class="c"></span>                <span class="nx">currentNode</span><span class="o">.</span><span class="nx">yuiColumnId</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_sId</span><span class="o">;</span>
                
                <span class="c">// Add the new Column to the flat list</span>
<span class="c"></span>                <span class="nx">flat</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">);</span>

                <span class="c">// Assign its parent as an attribute, if applicable</span>
<span class="c"></span>                <span class="k">if</span><span class="o">(</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_oParent</span> <span class="o">=</span> <span class="nx">parent</span><span class="o">;</span>
                <span class="o">}</span>

                <span class="c">// The Column has descendants</span>
<span class="c"></span>                <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">.</span><span class="nx">children</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">oColumn</span><span class="o">.</span><span class="nx">children</span> <span class="o">=</span> <span class="nx">currentNode</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>

                    <span class="c">// Determine COLSPAN value for this Column</span>
<span class="c"></span>                    <span class="k">var</span> <span class="nx">terminalChildNodes</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                    <span class="k">var</span> <span class="nx">countTerminalChildNodes</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ancestor</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">descendants</span> <span class="o">=</span> <span class="nx">ancestor</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>
                        <span class="c">// Drill down each branch and count terminal nodes</span>
<span class="c"></span>                        <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">k</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">k</span><span class="o">&lt;</span><span class="nx">descendants</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">k</span><span class="o">++)</span> <span class="o">{</span>
                            <span class="c">// Keep drilling down</span>
<span class="c"></span>                            <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">descendants</span><span class="o">[</span><span class="nx">k</span><span class="o">].</span><span class="nx">children</span><span class="o">))</span> <span class="o">{</span>
                                <span class="nx">countTerminalChildNodes</span><span class="o">(</span><span class="nx">descendants</span><span class="o">[</span><span class="nx">k</span><span class="o">]);</span>
                            <span class="o">}</span>
                            <span class="c">// Reached branch terminus</span>
<span class="c"></span>                            <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">terminalChildNodes</span><span class="o">++;</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">};</span>
                    <span class="nx">countTerminalChildNodes</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">);</span>
                    <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_nColspan</span> <span class="o">=</span> <span class="nx">terminalChildNodes</span><span class="o">;</span>

                    <span class="c">// Cascade certain properties to children if not defined on their own</span>
<span class="c"></span>                    <span class="k">var</span> <span class="nx">currentChildren</span> <span class="o">=</span> <span class="nx">currentNode</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>
                    <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">k</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">k</span><span class="o">&lt;</span><span class="nx">currentChildren</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">k</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">child</span> <span class="o">=</span> <span class="nx">currentChildren</span><span class="o">[</span><span class="nx">k</span><span class="o">];</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">className</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">className</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">className</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">editor</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">editor</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">editor</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">editor</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="c">//TODO: Deprecated</span>
<span class="c"></span>                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">editorOptions</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">editorOptions</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">editorOptions</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">editorOptions</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">formatter</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">formatter</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">formatter</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">formatter</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">resizeable</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">resizeable</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">resizeable</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">resizeable</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">sortable</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">sortable</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">sortable</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">sortable</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">hidden</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">hidden</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">width</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">minWidth</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">minWidth</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">minWidth</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">minWidth</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">maxAutoWidth</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">maxAutoWidth</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">maxAutoWidth</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">maxAutoWidth</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="c">// Backward compatibility</span>
<span class="c"></span>                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">type</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">type</span> <span class="o">===</span> <span class="kc">undefined</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">child</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">type</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">type</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">formatter</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The property type has been&quot;</span> <span class="o">+</span>
                            <span class="s2">&quot; deprecated in favor of formatter&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
                            <span class="nx">oColumn</span><span class="o">.</span><span class="nx">formatter</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">type</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">text</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isValue</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="k">label</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The property text has been&quot;</span> <span class="o">+</span>
                            <span class="s2">&quot; deprecated in favor of label&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
                            <span class="nx">oColumn</span><span class="o">.</span><span class="k">label</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">text</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">parser</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The property parser is no longer supported&quot;</span><span class="o">,</span>
                            <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
                        <span class="o">}</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">sortOptions</span> <span class="o">&amp;&amp;</span> <span class="o">((</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">sortOptions</span><span class="o">.</span><span class="nx">ascFunction</span><span class="o">)</span> <span class="o">||</span>
                                <span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">sortOptions</span><span class="o">.</span><span class="nx">descFunction</span><span class="o">)))</span> <span class="o">{</span>
                            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The properties sortOptions.ascFunction and &quot;</span> <span class="o">+</span>
                            <span class="s2">&quot; sortOptions.descFunction have been deprecated in favor &quot;</span> <span class="o">+</span>
                            <span class="s2">&quot; of sortOptions.sortFunction&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
                        <span class="o">}</span>
                    <span class="o">}</span>

                    <span class="c">// The children themselves must also be parsed for Column instances</span>
<span class="c"></span>                    <span class="k">if</span><span class="o">(!</span><span class="nx">tree</span><span class="o">[</span><span class="nx">nodeDepth</span><span class="o">+</span><span class="m">1</span><span class="o">])</span> <span class="o">{</span>
                        <span class="nx">tree</span><span class="o">[</span><span class="nx">nodeDepth</span><span class="o">+</span><span class="m">1</span><span class="o">]</span> <span class="o">=</span> <span class="o">[];</span>
                    <span class="o">}</span>
                    <span class="nx">parseColumns</span><span class="o">(</span><span class="nx">currentChildren</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="c">// This Column does not have any children</span>
<span class="c"></span>                <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_nKeyIndex</span> <span class="o">=</span> <span class="nx">keys</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
                    <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_nColspan</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
                    <span class="nx">keys</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="c">// Add the Column to the top-down tree</span>
<span class="c"></span>                <span class="nx">tree</span><span class="o">[</span><span class="nx">nodeDepth</span><span class="o">].</span><span class="nx">push</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="nx">nodeDepth</span><span class="o">--;</span>
        <span class="o">};</span>

        <span class="c">// Parse out Column instances from the array of object literals</span>
<span class="c"></span>        <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">parseColumns</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">);</span>

            <span class="c">// Store the array</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">_aDefinitions</span> <span class="o">=</span> <span class="nx">aDefinitions</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Could not initialize ColumnSet due to invalid definitions&quot;</span><span class="o">,</span><span class="s2">&quot;error&quot;</span><span class="o">);</span>
            <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">var</span> <span class="nx">i</span><span class="o">;</span>

        <span class="c">// Determine ROWSPAN value for each Column in the tree</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">parseTreeForRowspan</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">tree</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">maxRowDepth</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">currentRow</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">currentColumn</span><span class="o">;</span>

            <span class="c">// Calculate the max depth of descendants for this row</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">countMaxRowDepth</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">row</span><span class="o">,</span> <span class="nx">tmpRowDepth</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">tmpRowDepth</span> <span class="o">=</span> <span class="nx">tmpRowDepth</span> <span class="o">||</span> <span class="m">1</span><span class="o">;</span>

                <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">n</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">n</span><span class="o">&lt;</span><span class="nx">row</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">n</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">col</span> <span class="o">=</span> <span class="nx">row</span><span class="o">[</span><span class="nx">n</span><span class="o">];</span>
                    <span class="c">// Column has children, so keep counting</span>
<span class="c"></span>                    <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">col</span><span class="o">.</span><span class="nx">children</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">tmpRowDepth</span><span class="o">++;</span>
                        <span class="nx">countMaxRowDepth</span><span class="o">(</span><span class="nx">col</span><span class="o">.</span><span class="nx">children</span><span class="o">,</span> <span class="nx">tmpRowDepth</span><span class="o">);</span>
                        <span class="nx">tmpRowDepth</span><span class="o">--;</span>
                    <span class="o">}</span>
                    <span class="c">// No children, is it the max depth?</span>
<span class="c"></span>                    <span class="k">else</span> <span class="o">{</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">tmpRowDepth</span> <span class="o">&gt;</span> <span class="nx">maxRowDepth</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">maxRowDepth</span> <span class="o">=</span> <span class="nx">tmpRowDepth</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>

                <span class="o">}</span>
            <span class="o">};</span>

            <span class="c">// Count max row depth for each row</span>
<span class="c"></span>            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">m</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">m</span><span class="o">&lt;</span><span class="nx">tree</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">m</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">tree</span><span class="o">[</span><span class="nx">m</span><span class="o">];</span>
                <span class="nx">countMaxRowDepth</span><span class="o">(</span><span class="nx">currentRow</span><span class="o">);</span>

                <span class="c">// Assign the right ROWSPAN values to each Column in the row</span>
<span class="c"></span>                <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">p</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">p</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">p</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">currentColumn</span> <span class="o">=</span> <span class="nx">currentRow</span><span class="o">[</span><span class="nx">p</span><span class="o">];</span>
                    <span class="k">if</span><span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">currentColumn</span><span class="o">.</span><span class="nx">children</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">currentColumn</span><span class="o">.</span><span class="nx">_nRowspan</span> <span class="o">=</span> <span class="nx">maxRowDepth</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">currentColumn</span><span class="o">.</span><span class="nx">_nRowspan</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>

                <span class="c">// Reset counter for next row</span>
<span class="c"></span>                <span class="nx">maxRowDepth</span> <span class="o">=</span> <span class="m">1</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">};</span>
        <span class="nx">parseTreeForRowspan</span><span class="o">(</span><span class="nx">tree</span><span class="o">);</span>

        <span class="c">// Store tree index values</span>
<span class="c"></span>        <span class="k">for</span><span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">tree</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
            <span class="nx">tree</span><span class="o">[</span><span class="m">0</span><span class="o">][</span><span class="nx">i</span><span class="o">].</span><span class="nx">_nTreeIndex</span> <span class="o">=</span> <span class="nx">i</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c">// Store header relationships in an array for HEADERS attribute</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">recurseAncestorsForHeaders</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">i</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">headers</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">push</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">getSanitizedKey</span><span class="o">());</span>
            <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">.</span><span class="nx">_oParent</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">recurseAncestorsForHeaders</span><span class="o">(</span><span class="nx">i</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">_oParent</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">};</span>
        <span class="k">for</span><span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">keys</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
            <span class="nx">headers</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="nx">recurseAncestorsForHeaders</span><span class="o">(</span><span class="nx">i</span><span class="o">,</span> <span class="nx">keys</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
            <span class="nx">headers</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nx">headers</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">reverse</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="c">// Save to the ColumnSet instance</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">tree</span> <span class="o">=</span> <span class="nx">tree</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">flat</span> <span class="o">=</span> <span class="nx">flat</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">keys</span> <span class="o">=</span> <span class="nx">keys</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">headers</span> <span class="o">=</span> <span class="nx">headers</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Public methods</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Returns unique name of the ColumnSet instance.</span>
<span class="c">     *</span>
<span class="c">     * @method getId</span>
<span class="c">     * @return {String} Unique name of the ColumnSet instance.</span>
<span class="c">     */</span>

    <span class="nx">getId</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * ColumnSet instance name, for logging.</span>
<span class="c">     *</span>
<span class="c">     * @method toString</span>
<span class="c">     * @return {String} Unique name of the ColumnSet instance.</span>
<span class="c">     */</span>

    <span class="nx">toString</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="s2">&quot;ColumnSet instance &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor to the definitions array.</span>
<span class="c">     *</span>
<span class="c">     * @method getDefinitions</span>
<span class="c">     * @return {Object[]} Array of object literal Column definitions.</span>
<span class="c">     */</span>

    <span class="nx">getDefinitions</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">aDefinitions</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_aDefinitions</span><span class="o">;</span>
        
        <span class="c">// Internal recursive function to define Column instances</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">parseColumns</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">nodeList</span><span class="o">,</span> <span class="nx">oSelf</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// Parse each node at this depth for attributes and any children</span>
<span class="c"></span>            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">j</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">nodeList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">currentNode</span> <span class="o">=</span> <span class="nx">nodeList</span><span class="o">[</span><span class="nx">j</span><span class="o">];</span>
                
                <span class="c">// Get the Column for each node</span>
<span class="c"></span>                <span class="k">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="o">.</span><span class="nx">getColumnById</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">.</span><span class="nx">yuiColumnId</span><span class="o">);</span>
                
                <span class="k">if</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">)</span> <span class="o">{</span>    
                    <span class="c">// Update the current values</span>
<span class="c"></span>                    <span class="k">var</span> <span class="nx">oDefinition</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">getDefinition</span><span class="o">();</span>
                    <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">name</span> <span class="k">in</span> <span class="nx">oDefinition</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">oDefinition</span><span class="o">,</span> <span class="nx">name</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">currentNode</span><span class="o">[</span><span class="nx">name</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oDefinition</span><span class="o">[</span><span class="nx">name</span><span class="o">];</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                            
                <span class="c">// The Column has descendants</span>
<span class="c"></span>                <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">.</span><span class="nx">children</span><span class="o">))</span> <span class="o">{</span>
                    <span class="c">// The children themselves must also be parsed for Column instances</span>
<span class="c"></span>                    <span class="nx">parseColumns</span><span class="o">(</span><span class="nx">currentNode</span><span class="o">.</span><span class="nx">children</span><span class="o">,</span> <span class="nx">oSelf</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">};</span>

        <span class="nx">parseColumns</span><span class="o">(</span><span class="nx">aDefinitions</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_aDefinitions</span> <span class="o">=</span> <span class="nx">aDefinitions</span><span class="o">;</span>
        <span class="k">return</span> <span class="nx">aDefinitions</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns Column instance with given ID.</span>
<span class="c">     *</span>
<span class="c">     * @method getColumnById</span>
<span class="c">     * @param column {String} Column ID.</span>
<span class="c">     * @return {YAHOO.widget.Column} Column instance.</span>
<span class="c">     */</span>

    <span class="nx">getColumnById</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">column</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">column</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">allColumns</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">flat</span><span class="o">;</span>
            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="nx">allColumns</span><span class="o">.</span><span class="nx">length</span><span class="o">-</span><span class="m">1</span><span class="o">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="m">1</span><span class="o">;</span> <span class="nx">i</span><span class="o">--)</span> <span class="o">{</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">allColumns</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">_sId</span> <span class="o">===</span> <span class="nx">column</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="nx">allColumns</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns Column instance with given key or ColumnSet key index.</span>
<span class="c">     *</span>
<span class="c">     * @method getColumn</span>
<span class="c">     * @param column {String | Number} Column key or ColumnSet key index.</span>
<span class="c">     * @return {YAHOO.widget.Column} Column instance.</span>
<span class="c">     */</span>

    <span class="nx">getColumn</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">column</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">column</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">keys</span><span class="o">[</span><span class="nx">column</span><span class="o">])</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">keys</span><span class="o">[</span><span class="nx">column</span><span class="o">];</span>
        <span class="o">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">column</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">allColumns</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">flat</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">aColumns</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">allColumns</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">allColumns</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">key</span> <span class="o">===</span> <span class="nx">column</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">aColumns</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">allColumns</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span><span class="o">(</span><span class="nx">aColumns</span><span class="o">.</span><span class="nx">length</span> <span class="o">===</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="nx">aColumns</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
            <span class="o">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="nx">aColumns</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">1</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">return</span> <span class="nx">aColumns</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns array of given Column&#39;s desendants (if any), including itself.</span>
<span class="c">     *</span>
<span class="c">     * @method getDescendants</span>
<span class="c">     * @parem {YAHOO.widget.Column} Column instance.</span>
<span class="c">     * @return {Array} Array including the Column itself and all descendants (if any).</span>
<span class="c">     */</span>
    <span class="nx">getDescendants</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">oSelf</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
        <span class="k">var</span> <span class="nx">allDescendants</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="k">var</span> <span class="nx">i</span><span class="o">;</span>

        <span class="c">// Recursive function to loop thru all children</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">parse</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">oParent</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">allDescendants</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">oParent</span><span class="o">);</span>
            <span class="c">// This Column has children</span>
<span class="c"></span>            <span class="k">if</span><span class="o">(</span><span class="nx">oParent</span><span class="o">.</span><span class="nx">children</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">for</span><span class="o">(</span><span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oParent</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="nx">parse</span><span class="o">(</span><span class="nx">oSelf</span><span class="o">.</span><span class="nx">getColumn</span><span class="o">(</span><span class="nx">oParent</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">key</span><span class="o">));</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">};</span>
        <span class="nx">parse</span><span class="o">(</span><span class="nx">oColumn</span><span class="o">);</span>

        <span class="k">return</span> <span class="nx">allDescendants</span><span class="o">;</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>

<span class="c">/**</span>
<span class="c"> * The Column class defines and manages attributes of DataTable Columns</span>
<span class="c"> *</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @class Column</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param oConfigs {Object} Object literal of definitions.</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">oConfigs</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span> <span class="o">=</span> <span class="s2">&quot;yui-col&quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">.</span><span class="nx">_nCount</span><span class="o">;</span>
    
    <span class="c">// Object literal defines Column attributes</span>
<span class="c"></span>    <span class="k">if</span><span class="o">(</span><span class="nx">oConfigs</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">oConfigs</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">sConfig</span> <span class="k">in</span> <span class="nx">oConfigs</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span><span class="o">(</span><span class="nx">sConfig</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">[</span><span class="nx">sConfig</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oConfigs</span><span class="o">[</span><span class="nx">sConfig</span><span class="o">];</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="c">// Assign a key if not found</span>
<span class="c"></span>    <span class="k">if</span><span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isValue</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">key</span> <span class="o">=</span> <span class="s2">&quot;yui-dt-col&quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">.</span><span class="nx">_nCount</span><span class="o">;</span>
    <span class="o">}</span>
    
    <span class="c">// Assign a field if not found, defaults to key</span>
<span class="c"></span>    <span class="k">if</span><span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isValue</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">field</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">field</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="c">// Increment counter</span>
<span class="c"></span>    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">.</span><span class="nx">_nCount</span><span class="o">++;</span>

    <span class="c">// Backward compatibility</span>
<span class="c"></span>    <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">width</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The Column property width must be a number&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    <span class="o">}</span>
    <span class="k">if</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">editor</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">editor</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">editor</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CellEditor</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">editor</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">editorOptions</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The Column property editor must be an instance of YAHOO.widget.CellEditor&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c">//</span>
<span class="c">// Private member variables</span>
<span class="c">//</span>
<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">augmentObject</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">,</span> <span class="o">{</span>
    <span class="c">/**</span>
<span class="c">     * Internal class variable to index multiple Column instances.</span>
<span class="c">     *</span>
<span class="c">     * @property Column._nCount</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     * @static</span>
<span class="c">     */</span>
    <span class="nx">_nCount</span> <span class="o">:</span> <span class="m">0</span><span class="o">,</span>

    <span class="nx">formatCheckbox</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatCheckbox() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatCheckbox()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatCheckbox&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatCheckbox</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatCurrency</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatCurrency() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatCurrency()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatCurrency&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatCurrency</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatDate</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatDate() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatDate()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatDate&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatDate</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatEmail</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatEmail() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatEmail()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatEmail&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatEmail</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatLink</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatLink() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatLink()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatLink&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatLink</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatNumber</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatNumber() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatNumber()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatNumber&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatNumber</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="nx">formatSelect</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method YAHOO.widget.Column.formatSelect() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of YAHOO.widget.DataTable.formatDropdown()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="s2">&quot;YAHOO.widget.Column.formatSelect&quot;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DataTable</span><span class="o">.</span><span class="nx">formatDropdown</span><span class="o">(</span><span class="nx">elCell</span><span class="o">,</span> <span class="nx">oRecord</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">oData</span><span class="o">);</span>
    <span class="o">}</span>
<span class="o">});</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Column</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>
    <span class="c">/**</span>
<span class="c">     * Unique String identifier assigned at instantiation.</span>
<span class="c">     *</span>
<span class="c">     * @property _sId</span>
<span class="c">     * @type String</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_sId</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Reference to Column&#39;s current position index within its ColumnSet&#39;s keys</span>
<span class="c">     * array, if applicable. This property only applies to non-nested and bottom-</span>
<span class="c">     * level child Columns.</span>
<span class="c">     *</span>
<span class="c">     * @property _nKeyIndex</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nKeyIndex</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Reference to Column&#39;s current position index within its ColumnSet&#39;s tree</span>
<span class="c">     * array, if applicable. This property only applies to non-nested and top-</span>
<span class="c">     * level parent Columns.</span>
<span class="c">     *</span>
<span class="c">     * @property _nTreeIndex</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nTreeIndex</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Number of table cells the Column spans.</span>
<span class="c">     *</span>
<span class="c">     * @property _nColspan</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nColspan</span> <span class="o">:</span> <span class="m">1</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Number of table rows the Column spans.</span>
<span class="c">     *</span>
<span class="c">     * @property _nRowspan</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nRowspan</span> <span class="o">:</span> <span class="m">1</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Column&#39;s parent Column instance, or null.</span>
<span class="c">     *</span>
<span class="c">     * @property _oParent</span>
<span class="c">     * @type YAHOO.widget.Column</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_oParent</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The DOM reference to the associated TH element.</span>
<span class="c">     *</span>
<span class="c">     * @property _elTh</span>
<span class="c">     * @type HTMLElement</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_elTh</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The DOM reference to the associated TH element&#39;s liner DIV element.</span>
<span class="c">     *</span>
<span class="c">     * @property _elThLiner</span>
<span class="c">     * @type HTMLElement</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_elThLiner</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The DOM reference to the associated TH element&#39;s label SPAN element.</span>
<span class="c">     *</span>
<span class="c">     * @property _elThLabel</span>
<span class="c">     * @type HTMLElement</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_elThLabel</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The DOM reference to the associated resizerelement (if any).</span>
<span class="c">     *</span>
<span class="c">     * @property _elResizer</span>
<span class="c">     * @type HTMLElement</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_elResizer</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Internal width tracker.</span>
<span class="c">     *</span>
<span class="c">     * @property _nWidth</span>
<span class="c">     * @type Number</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nWidth</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * For unreg() purposes, a reference to the Column&#39;s DragDrop instance.</span>
<span class="c">     *</span>
<span class="c">     * @property _dd</span>
<span class="c">     * @type YAHOO.util.DragDrop</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_dd</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * For unreg() purposes, a reference to the Column resizer&#39;s DragDrop instance.</span>
<span class="c">     *</span>
<span class="c">     * @property _ddResizer</span>
<span class="c">     * @type YAHOO.util.DragDrop</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_ddResizer</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Public member variables</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Unique name, required.</span>
<span class="c">     *</span>
<span class="c">     * @property key</span>
<span class="c">     * @type String</span>
<span class="c">     */</span>
    <span class="nx">key</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Associated database field, or null.</span>
<span class="c">     *</span>
<span class="c">     * @property field</span>
<span class="c">     * @type String</span>
<span class="c">     */</span>
    <span class="nx">field</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Text or HTML for display as Column&#39;s label in the TH element.</span>
<span class="c">     *</span>
<span class="c">     * @property label</span>
<span class="c">     * @type String</span>
<span class="c">     */</span>
    <span class="k">label</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Column head cell ABBR for accessibility.</span>
<span class="c">     *</span>
<span class="c">     * @property abbr</span>
<span class="c">     * @type String</span>
<span class="c">     */</span>
    <span class="nx">abbr</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Array of object literals that define children (nested headers) of a Column.</span>
<span class="c">     *</span>
<span class="c">     * @property children</span>
<span class="c">     * @type Object[]</span>
<span class="c">     */</span>
    <span class="nx">children</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Column width (in pixels).</span>
<span class="c">     *</span>
<span class="c">     * @property width</span>
<span class="c">     * @type Number</span>
<span class="c">     */</span>
    <span class="nx">width</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Minimum Column width (in pixels).</span>
<span class="c">     *</span>
<span class="c">     * @property minWidth</span>
<span class="c">     * @type Number</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="nx">minWidth</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * When a width is not defined for a Column, maxAutoWidth defines an upper</span>
<span class="c">     * limit that the Column should be auto-sized to. If resizeable is enabled, </span>
<span class="c">     * users may still resize to a greater width. Most useful for Columns intended</span>
<span class="c">     * to hold long unbroken, unwrapped Strings, such as URLs, to prevent very</span>
<span class="c">     * wide Columns from disrupting visual readability by inducing truncation.</span>
<span class="c">     *</span>
<span class="c">     * @property maxAutoWidth</span>
<span class="c">     * @type Number</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="nx">maxAutoWidth</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * True if Column is in hidden state.</span>
<span class="c">     *</span>
<span class="c">     * @property hidden</span>
<span class="c">     * @type Boolean</span>
<span class="c">     * @default false     </span>
<span class="c">     */</span>
    <span class="nx">hidden</span> <span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * True if Column is in selected state.</span>
<span class="c">     *</span>
<span class="c">     * @property selected</span>
<span class="c">     * @type Boolean</span>
<span class="c">     * @default false     </span>
<span class="c">     */</span>
    <span class="nx">selected</span> <span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Custom CSS class or array of classes to be applied to every cell in the Column.</span>
<span class="c">     *</span>
<span class="c">     * @property className</span>
<span class="c">     * @type String || String[]</span>
<span class="c">     */</span>
    <span class="nx">className</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Defines a format function.</span>
<span class="c">     *</span>
<span class="c">     * @property formatter</span>
<span class="c">     * @type String || HTMLFunction</span>
<span class="c">     */</span>
    <span class="nx">formatter</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
    
    <span class="c">/**</span>
<span class="c">     * Config passed to YAHOO.util.Number.format() by the &#39;currency&#39; Column formatter.</span>
<span class="c">     *</span>
<span class="c">     * @property currencyOptions</span>
<span class="c">     * @type Object</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="nx">currencyOptions</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Config passed to YAHOO.util.Date.format() by the &#39;date&#39; Column formatter.</span>
<span class="c">     *</span>
<span class="c">     * @property dateOptions</span>
<span class="c">     * @type Object</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="nx">dateOptions</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * A CellEditor instance, otherwise Column is not editable.     </span>
<span class="c">     *</span>
<span class="c">     * @property editor</span>
<span class="c">     * @type YAHOO.widget.CellEditor</span>
<span class="c">     */</span>
    <span class="nx">editor</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * True if Column is resizeable, false otherwise. The Drag &amp; Drop Utility is</span>
<span class="c">     * required to enable this feature. Only bottom-level and non-nested Columns are</span>
<span class="c">     * resizeble. </span>
<span class="c">     *</span>
<span class="c">     * @property resizeable</span>
<span class="c">     * @type Boolean</span>
<span class="c">     * @default false</span>
<span class="c">     */</span>
    <span class="nx">resizeable</span> <span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * True if Column is sortable, false otherwise.</span>
<span class="c">     *</span>
<span class="c">     * @property sortable</span>
<span class="c">     * @type Boolean</span>
<span class="c">     * @default false</span>
<span class="c">     */</span>
    <span class="nx">sortable</span> <span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * @property sortOptions.defaultOrder</span>
<span class="c">     * @deprecated Use sortOptions.defaultDir.</span>
<span class="c">     */</span>
    <span class="c">/**</span>
<span class="c">     * Default sort direction for Column: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.</span>
<span class="c">     *</span>
<span class="c">     * @property sortOptions.defaultDir</span>
<span class="c">     * @type String</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="c">/**</span>
<span class="c">     * Custom field to sort on.</span>
<span class="c">     *</span>
<span class="c">     * @property sortOptions.field</span>
<span class="c">     * @type String</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="c">/**</span>
<span class="c">     * Custom sort handler.</span>
<span class="c">     *</span>
<span class="c">     * @property sortOptions.sortFunction</span>
<span class="c">     * @type Function</span>
<span class="c">     * @default null</span>
<span class="c">     */</span>
    <span class="nx">sortOptions</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>















    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Public methods</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Returns unique ID string.</span>
<span class="c">     *</span>
<span class="c">     * @method getId</span>
<span class="c">     * @return {String} Unique ID string.</span>
<span class="c">     */</span>
    <span class="nx">getId</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Column instance name, for logging.</span>
<span class="c">     *</span>
<span class="c">     * @method toString</span>
<span class="c">     * @return {String} Column&#39;s unique name.</span>
<span class="c">     */</span>
    <span class="nx">toString</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="s2">&quot;Column instance &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sId</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns object literal definition.</span>
<span class="c">     *</span>
<span class="c">     * @method getDefinition</span>
<span class="c">     * @return {Object} Object literal definition.</span>
<span class="c">     */</span>
    <span class="nx">getDefinition</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">oDefinition</span> <span class="o">=</span> <span class="o">{};</span>
        
        <span class="c">// Update the definition</span>
<span class="c"></span>        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">abbr</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">abbr</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">className</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">editor</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">editor</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">editorOptions</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">editorOptions</span><span class="o">;</span> <span class="c">//TODO: deprecated</span>
<span class="c"></span>        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">field</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">field</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">formatter</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">formatter</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">hidden</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">hidden</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">key</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="k">label</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="k">label</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">minWidth</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">minWidth</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">maxAutoWidth</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">maxAutoWidth</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">resizeable</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">resizeable</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">selected</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">sortable</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">sortable</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">sortOptions</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">sortOptions</span><span class="o">;</span>
        <span class="nx">oDefinition</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">width</span><span class="o">;</span>

        <span class="k">return</span> <span class="nx">oDefinition</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns unique Column key.</span>
<span class="c">     *</span>
<span class="c">     * @method getKey</span>
<span class="c">     * @return {String} Column key.</span>
<span class="c">     */</span>
    <span class="nx">getKey</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
    <span class="o">},</span>
    
    <span class="c">/**</span>
<span class="c">     * Returns field.</span>
<span class="c">     *</span>
<span class="c">     * @method getField</span>
<span class="c">     * @return {String} Column field.</span>
<span class="c">     */</span>
    <span class="nx">getField</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">field</span><span class="o">;</span>
    <span class="o">},</span>
    
    <span class="c">/**</span>
<span class="c">     * Returns Column key which has been sanitized for DOM (class and ID) usage</span>
<span class="c">     * starts with letter, contains only letters, numbers, hyphen, or period.</span>
<span class="c">     *</span>
<span class="c">     * @method getSanitizedKey</span>
<span class="c">     * @return {String} Sanitized Column key.</span>
<span class="c">     */</span>
    <span class="nx">getSanitizedKey</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getKey</span><span class="o">().</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/[^\w\-.:]/g</span><span class="o">,</span><span class="s2">&quot;&quot;</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns Column&#39;s current position index within its</span>
<span class="c">     * ColumnSet&#39;s keys array, if applicable. Only non-nested and bottom-level</span>
<span class="c">     * child Columns will return a value.</span>
<span class="c">     *</span>
<span class="c">     * @method getKeyIndex</span>
<span class="c">     * @return {Number} Position index, or null.</span>
<span class="c">     */</span>
    <span class="nx">getKeyIndex</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nKeyIndex</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns Column&#39;s current position index within its</span>
<span class="c">     * ColumnSet&#39;s tree array, if applicable. Only non-nested and top-level parent</span>
<span class="c">     * Columns will return a value;</span>
<span class="c">     *</span>
<span class="c">     * @method getTreeIndex</span>
<span class="c">     * @return {Number} Position index, or null.</span>
<span class="c">     */</span>
    <span class="nx">getTreeIndex</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nTreeIndex</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns Column&#39;s parent instance if any, or null otherwise.</span>
<span class="c">     *</span>
<span class="c">     * @method getParent</span>
<span class="c">     * @return {YAHOO.widget.Column} Column&#39;s parent instance.</span>
<span class="c">     */</span>
    <span class="nx">getParent</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_oParent</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns Column&#39;s calculated COLSPAN value.</span>
<span class="c">     *</span>
<span class="c">     * @method getColspan</span>
<span class="c">     * @return {Number} Column&#39;s COLSPAN value.</span>
<span class="c">     */</span>
    <span class="nx">getColspan</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nColspan</span><span class="o">;</span>
    <span class="o">},</span>
    <span class="c">// Backward compatibility</span>
<span class="c"></span>    <span class="nx">getColSpan</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method getColSpan() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of getColspan()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getColspan</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Public accessor returns Column&#39;s calculated ROWSPAN value.</span>
<span class="c">     *</span>
<span class="c">     * @method getRowspan</span>
<span class="c">     * @return {Number} Column&#39;s ROWSPAN value.</span>
<span class="c">     */</span>
    <span class="nx">getRowspan</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nRowspan</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns DOM reference to the key TH element.</span>
<span class="c">     *</span>
<span class="c">     * @method getThEl</span>
<span class="c">     * @return {HTMLElement} TH element.</span>
<span class="c">     */</span>
    <span class="nx">getThEl</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_elTh</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns DOM reference to the TH&#39;s liner DIV element. Introduced since</span>
<span class="c">     * resizeable Columns may have an extra resizer liner, making the DIV liner</span>
<span class="c">     * not reliably the TH element&#39;s first child.               </span>
<span class="c">     *</span>
<span class="c">     * @method getThLInerEl</span>
<span class="c">     * @return {HTMLElement} TH element.</span>
<span class="c">     */</span>
    <span class="nx">getThLinerEl</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_elThLiner</span><span class="o">;</span>
    <span class="o">},</span>
    
    <span class="c">/**</span>
<span class="c">     * Returns DOM reference to the resizer element, or null.</span>
<span class="c">     *</span>
<span class="c">     * @method getResizerEl</span>
<span class="c">     * @return {HTMLElement} DIV element.</span>
<span class="c">     */</span>
    <span class="nx">getResizerEl</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_elResizer</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">// Backward compatibility</span>
<span class="c"></span>    <span class="c">/**</span>
<span class="c">     * @method getColEl</span>
<span class="c">     * @deprecated Use getThEl</span>
<span class="c">     */</span>
    <span class="nx">getColEl</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method getColEl() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of getThEl()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getThEl</span><span class="o">();</span>
    <span class="o">},</span>
    <span class="nx">getIndex</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method getIndex() has been&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; deprecated in favor of getKeyIndex()&quot;</span><span class="o">,</span> <span class="s2">&quot;warn&quot;</span><span class="o">,</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getKeyIndex</span><span class="o">();</span>
    <span class="o">},</span>
    <span class="nx">format</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;The method format() has been deprecated in favor of the &quot;</span> <span class="o">+</span>
        <span class="s2">&quot;DataTable method formatCell()&quot;</span><span class="o">,</span> <span class="s2">&quot;error&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>

<span class="c">/**</span>
<span class="c"> * Sort static utility to support Column sorting.</span>
<span class="c"> *</span>
<span class="c"> * @namespace YAHOO.util</span>
<span class="c"> * @class Sort</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Sort</span> <span class="o">=</span> <span class="o">{</span>
    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">// Public methods</span>
<span class="c"></span>    <span class="c">//</span>
<span class="c"></span>    <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
    <span class="c">/**</span>
<span class="c">     * Comparator function for simple case-insensitive string sorting.</span>
<span class="c">     *</span>
<span class="c">     * @method compare</span>
<span class="c">     * @param a {Object} First sort argument.</span>
<span class="c">     * @param b {Object} Second sort argument.</span>
<span class="c">     * @param desc {Boolean} True if sort direction is descending, false if</span>
<span class="c">     * sort direction is ascending.</span>
<span class="c">     */</span>
    <span class="nx">compare</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">a</span><span class="o">,</span> <span class="nx">b</span><span class="o">,</span> <span class="nx">desc</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span><span class="o">((</span><span class="nx">a</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">a</span> <span class="o">==</span> <span class="s2">&quot;undefined&quot;</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">if</span><span class="o">((</span><span class="nx">b</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">b</span> <span class="o">==</span> <span class="s2">&quot;undefined&quot;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="m">1</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="o">((</span><span class="nx">b</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="k">typeof</span> <span class="nx">b</span> <span class="o">==</span> <span class="s2">&quot;undefined&quot;</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">return</span> <span class="o">-</span><span class="m">1</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span><span class="o">(</span><span class="nx">a</span><span class="o">.</span><span class="nx">constructor</span> <span class="o">==</span> <span class="nb">String</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">a</span> <span class="o">=</span> <span class="nx">a</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
        <span class="o">}</span>
        <span class="k">if</span><span class="o">(</span><span class="nx">b</span><span class="o">.</span><span class="nx">constructor</span> <span class="o">==</span> <span class="nb">String</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">b</span> <span class="o">=</span> <span class="nx">b</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
        <span class="o">}</span>
        <span class="k">if</span><span class="o">(</span><span class="nx">a</span> <span class="o">&lt;</span> <span class="nx">b</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="o">(</span><span class="nx">desc</span><span class="o">)</span> <span class="o">?</span> <span class="m">1</span> <span class="o">:</span> <span class="o">-</span><span class="m">1</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">a</span> <span class="o">&gt;</span> <span class="nx">b</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span> <span class="o">(</span><span class="nx">desc</span><span class="o">)</span> <span class="o">?</span> <span class="o">-</span><span class="m">1</span> <span class="o">:</span> <span class="m">1</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">else</span> <span class="o">{</span>
            <span class="k">return</span> <span class="m">0</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>

<span class="c">/**</span>
<span class="c"> * ColumnDD subclasses DragDrop to support rearrangeable Columns.</span>
<span class="c"> *</span>
<span class="c"> * @namespace YAHOO.util</span>
<span class="c"> * @class ColumnDD</span>
<span class="c"> * @extends YAHOO.util.DDProxy</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="c"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="c"> * @param elTh {HTMLElement} TH element reference.</span>
<span class="c"> * @param elTarget {HTMLElement} Drag target element.</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnDD</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">oDataTable</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">elTh</span><span class="o">,</span> <span class="nx">elTarget</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">if</span><span class="o">(</span><span class="nx">oDataTable</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">elTh</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span> <span class="o">=</span> <span class="nx">oDataTable</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">table</span> <span class="o">=</span> <span class="nx">oDataTable</span><span class="o">.</span><span class="nx">getTableEl</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">column</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">headCell</span> <span class="o">=</span> <span class="nx">elTh</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">pointer</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">newIndex</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">elTh</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">initFrame</span><span class="o">();</span> <span class="c">// Needed for DDProxy</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">invalidHandleTypes</span> <span class="o">=</span> <span class="o">{};</span>

        <span class="c">// Set top/bottom padding to account for children of nested columns</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">setPadding</span><span class="o">(</span><span class="m">10</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getTheadEl</span><span class="o">().</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="m">10</span><span class="o">)</span> <span class="o">,</span> <span class="m">0</span><span class="o">);</span>

        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span> <span class="s1">&#39;resize&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">initConstraints</span><span class="o">();</span>
        <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Column dragdrop could not be created&quot;</span><span class="o">,</span><span class="s2">&quot;warn&quot;</span><span class="o">,</span><span class="nx">oDataTable</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DDProxy</span><span class="o">)</span> <span class="o">{</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">ColumnDD</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DDProxy</span><span class="o">,</span> <span class="o">{</span>
        <span class="nx">initConstraints</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="c">//Get the top, right, bottom and left positions</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">region</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getRegion</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">table</span><span class="o">),</span>
                <span class="c">//Get the element we are working on</span>
<span class="c"></span>                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">(),</span>
                <span class="c">//Get the xy position of it</span>
<span class="c"></span>                <span class="nx">xy</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="nx">el</span><span class="o">),</span>
                <span class="c">//Get the width and height</span>
<span class="c"></span>                <span class="nx">width</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;width&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">),</span>
                <span class="nx">height</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;height&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">),</span>
                <span class="c">//Set left to x minus left</span>
<span class="c"></span>                <span class="nx">left</span> <span class="o">=</span> <span class="o">((</span><span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">region</span><span class="o">.</span><span class="nx">left</span><span class="o">)</span> <span class="o">+</span> <span class="m">15</span><span class="o">),</span> <span class="c">//Buffer of 15px</span>
<span class="c"></span>                <span class="c">//Set right to right minus x minus width</span>
<span class="c"></span>                <span class="nx">right</span> <span class="o">=</span> <span class="o">((</span><span class="nx">region</span><span class="o">.</span><span class="nx">right</span> <span class="o">-</span> <span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">-</span> <span class="nx">width</span><span class="o">)</span> <span class="o">+</span> <span class="m">15</span><span class="o">);</span>
    
            <span class="c">//Set the constraints based on the above calculations</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">setXConstraint</span><span class="o">(</span><span class="nx">left</span><span class="o">,</span> <span class="nx">right</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setYConstraint</span><span class="o">(</span><span class="m">10</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>            
        <span class="o">},</span>
        <span class="nx">_resizeProxy</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">constructor</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">_resizeProxy</span><span class="o">.</span><span class="nx">apply</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">dragEl</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getDragEl</span><span class="o">(),</span>
                <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">();</span>

            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">table</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="m">10</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="s1">&#39;display&#39;</span><span class="o">,</span> <span class="s1">&#39;block&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">xy</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="o">[</span><span class="nx">xy</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="o">(</span><span class="nx">xy</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">-</span> <span class="m">5</span><span class="o">)]);</span>
            
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">dragEl</span><span class="o">,</span> <span class="s1">&#39;height&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getContainerEl</span><span class="o">().</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="nx">dragEl</span><span class="o">,</span> <span class="s1">&#39;width&#39;</span><span class="o">,</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">dragEl</span><span class="o">,</span> <span class="s1">&#39;width&#39;</span><span class="o">),</span><span class="m">10</span><span class="o">)</span> <span class="o">+</span> <span class="m">4</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="o">);</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setXY</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dragEl</span><span class="o">,</span> <span class="nx">xy</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="nx">onMouseDown</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">initConstraints</span><span class="o">();</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">resetConstraints</span><span class="o">();</span>
        <span class="o">},</span>
        <span class="nx">clickValidator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span><span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">.</span><span class="nx">hidden</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
                <span class="k">return</span> <span class="o">(</span> <span class="k">this</span><span class="o">.</span><span class="nx">isValidHandleChild</span><span class="o">(</span><span class="nx">target</span><span class="o">)</span> <span class="o">&amp;&amp;</span>
                            <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">==</span> <span class="k">this</span><span class="o">.</span><span class="nx">handleElId</span> <span class="o">||</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">DDM</span><span class="o">.</span><span class="nx">handleWasClicked</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">))</span> <span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="nx">onDragOver</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// Validate target as a Column</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getColumn</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="k">if</span><span class="o">(</span><span class="nx">target</span><span class="o">)</span> <span class="o">{</span>                
                <span class="c">// Validate target as a top-level parent</span>
<span class="c"></span>                <span class="k">var</span> <span class="nx">targetIndex</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getTreeIndex</span><span class="o">();</span>
                <span class="k">while</span><span class="o">((</span><span class="nx">targetIndex</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getParent</span><span class="o">())</span> <span class="o">{</span>
                    <span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getParent</span><span class="o">();</span>
                    <span class="nx">targetIndex</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getTreeIndex</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">targetIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">// Are we placing to left or right of target?</span>
<span class="c"></span>                    <span class="k">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getThEl</span><span class="o">();</span>
                    <span class="k">var</span> <span class="nx">newIndex</span> <span class="o">=</span> <span class="nx">targetIndex</span><span class="o">;</span>
                    <span class="k">var</span> <span class="nx">mouseX</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getPageX</span><span class="o">(</span><span class="nx">ev</span><span class="o">),</span>
                        <span class="nx">targetX</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getX</span><span class="o">(</span><span class="nx">elTarget</span><span class="o">),</span>
                        <span class="nx">midX</span> <span class="o">=</span> <span class="nx">targetX</span> <span class="o">+</span> <span class="o">((</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">elTarget</span><span class="o">).</span><span class="nx">offsetWidth</span><span class="o">)/</span><span class="m">2</span><span class="o">),</span>
                        <span class="nx">currentIndex</span> <span class="o">=</span>  <span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">.</span><span class="nx">getTreeIndex</span><span class="o">();</span>
                    
                    <span class="k">if</span> <span class="o">(</span><span class="nx">mouseX</span> <span class="o">&lt;</span> <span class="nx">midX</span><span class="o">)</span> <span class="o">{</span>
                       <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="nx">targetX</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">targetWidth</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">elTarget</span><span class="o">.</span><span class="nx">offsetWidth</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="o">(</span><span class="nx">targetX</span> <span class="o">+</span> <span class="nx">targetWidth</span><span class="o">));</span>
                        <span class="nx">newIndex</span><span class="o">++;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">targetIndex</span> <span class="o">&gt;</span> <span class="nx">currentIndex</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newIndex</span><span class="o">--;</span>
                    <span class="o">}</span>
                    <span class="k">if</span><span class="o">(</span><span class="nx">newIndex</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newIndex</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="nx">newIndex</span> <span class="o">&gt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getColumnSet</span><span class="o">().</span><span class="nx">tree</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newIndex</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getColumnSet</span><span class="o">().</span><span class="nx">tree</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">length</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">newIndex</span> <span class="o">=</span> <span class="nx">newIndex</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="nx">onDragDrop</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">reorderColumn</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">newIndex</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="nx">endDrag</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">newIndex</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">pointer</span><span class="o">,</span> <span class="s1">&#39;display&#39;</span><span class="o">,</span> <span class="s1">&#39;none&#39;</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">});</span>
<span class="o">}</span>

<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>
<span class="c">/****************************************************************************/</span>

<span class="c">/**</span>
<span class="c"> * ColumnResizer subclasses DragDrop to support resizeable Columns.</span>
<span class="c"> *</span>
<span class="c"> * @namespace YAHOO.util</span>
<span class="c"> * @class ColumnResizer</span>
<span class="c"> * @extends YAHOO.util.DDProxy</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="c"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="c"> * @param elTh {HTMLElement} TH element reference.</span>
<span class="c"> * @param sHandleElId {String} DOM ID of the handle element that causes the resize.</span>
<span class="c"> * @param elProxy {HTMLElement} Resizer proxy element.</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">ColumnResizer</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">oDataTable</span><span class="o">,</span> <span class="nx">oColumn</span><span class="o">,</span> <span class="nx">elTh</span><span class="o">,</span> <span class="nx">sHandleId</span><span class="o">,</span> <span class="nx">elProxy</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">if</span><span class="o">(</span><span class="nx">oDataTable</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">elTh</span> <span class="o">&amp;&amp;</span> <span class="nx">sHandleId</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span> <span class="o">=</span> <span class="nx">oDataTable</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">column</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">headCell</span> <span class="o">=</span> <span class="nx">elTh</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="o">.</span><span class="nx">getThLinerEl</span><span class="o">();</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">resizerLiner</span> <span class="o">=</span> <span class="nx">elTh</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">sHandleId</span><span class="o">,</span> <span class="nx">sHandleId</span><span class="o">,</span> <span class="o">{</span><span class="nx">dragOnly</span><span class="o">:</span><span class="kc">true</span><span class="o">,</span> <span class="nx">dragElId</span><span class="o">:</span> <span class="nx">elProxy</span><span class="o">.</span><span class="nx">id</span><span class="o">});</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">initFrame</span><span class="o">();</span> <span class="c">// Needed for proxy</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">resetResizerEl</span><span class="o">();</span> <span class="c">// Needed when rowspan &gt; 0</span>
<span class="c"></span>
        <span class="c">// Set right padding for bug 1858462</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">setPadding</span><span class="o">(</span><span class="m">0</span><span class="o">,</span> <span class="m">1</span><span class="o">,</span> <span class="m">0</span><span class="o">,</span> <span class="m">0</span><span class="o">);</span>
    <span class="o">}</span>
    <span class="k">else</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Column resizer could not be created&quot;</span><span class="o">,</span><span class="s2">&quot;warn&quot;</span><span class="o">,</span><span class="nx">oDataTable</span><span class="o">.</span><span class="nx">toString</span><span class="o">());</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="k">if</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DD</span><span class="o">)</span> <span class="o">{</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">ColumnResizer</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DDProxy</span><span class="o">,</span> <span class="o">{</span>
        <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>        <span class="c">//</span>
<span class="c"></span>        <span class="c">// Public methods</span>
<span class="c"></span>        <span class="c">//</span>
<span class="c"></span>        <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>        <span class="c">/**</span>
<span class="c">         * Resets resizer element.</span>
<span class="c">         *</span>
<span class="c">         * @method resetResizerEl</span>
<span class="c">         */</span>
        <span class="nx">resetResizerEl</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">resizerStyle</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">handleElId</span><span class="o">).</span><span class="nx">style</span><span class="o">;</span>
            <span class="nx">resizerStyle</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="s2">&quot;auto&quot;</span><span class="o">;</span>
            <span class="nx">resizerStyle</span><span class="o">.</span><span class="nx">right</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="nx">resizerStyle</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="s2">&quot;auto&quot;</span><span class="o">;</span>
            <span class="nx">resizerStyle</span><span class="o">.</span><span class="nx">bottom</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="nx">resizerStyle</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">headCell</span><span class="o">.</span><span class="nx">offsetHeight</span><span class="o">+</span><span class="s2">&quot;px&quot;</span><span class="o">;</span>
        <span class="o">},</span>
    
        <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>        <span class="c">//</span>
<span class="c"></span>        <span class="c">// Public DOM event handlers</span>
<span class="c"></span>        <span class="c">//</span>
<span class="c"></span>        <span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>    
        <span class="c">/**</span>
<span class="c">         * Handles mouseup events on the Column resizer.</span>
<span class="c">         *</span>
<span class="c">         * @method onMouseUp</span>
<span class="c">         * @param e {string} The mouseup event</span>
<span class="c">         */</span>
        <span class="nx">onMouseUp</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// Reset height of all resizer els in case TH&#39;s have changed height</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getColumnSet</span><span class="o">().</span><span class="nx">keys</span><span class="o">,</span>
                <span class="nx">col</span><span class="o">;</span>
            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">col</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">col</span><span class="o">.</span><span class="nx">_ddResizer</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">col</span><span class="o">.</span><span class="nx">_ddResizer</span><span class="o">.</span><span class="nx">resetResizerEl</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">resetResizerEl</span><span class="o">();</span>
            
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">newWidth</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">offsetWidth</span> <span class="o">-</span>
                <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s2">&quot;paddingLeft&quot;</span><span class="o">),</span><span class="m">10</span><span class="o">)|</span><span class="m">0</span><span class="o">)</span> <span class="o">-</span>
                <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s2">&quot;paddingRight&quot;</span><span class="o">),</span><span class="m">10</span><span class="o">)|</span><span class="m">0</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;columnResizeEvent&quot;</span><span class="o">,</span> <span class="o">{</span><span class="nx">column</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">,</span><span class="nx">target</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">headCell</span><span class="o">,</span><span class="nx">width</span><span class="o">:</span><span class="nx">newWidth</span><span class="o">});</span>
        <span class="o">},</span>
    
        <span class="c">/**</span>
<span class="c">         * Handles mousedown events on the Column resizer.</span>
<span class="c">         *</span>
<span class="c">         * @method onMouseDown</span>
<span class="c">         * @param e {string} The mousedown event</span>
<span class="c">         */</span>
        <span class="nx">onMouseDown</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">startWidth</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span><span class="o">.</span><span class="nx">offsetWidth</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">startX</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="nx">e</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">nLinerPadding</span> <span class="o">=</span> <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span><span class="o">,</span><span class="s2">&quot;paddingLeft&quot;</span><span class="o">),</span><span class="m">10</span><span class="o">)|</span><span class="m">0</span><span class="o">)</span> <span class="o">+</span>
                    <span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span><span class="o">,</span><span class="s2">&quot;paddingRight&quot;</span><span class="o">),</span><span class="m">10</span><span class="o">)|</span><span class="m">0</span><span class="o">);</span>
        <span class="o">},</span>
    
        <span class="c">/**</span>
<span class="c">         * Custom clickValidator to ensure Column is not in hidden state.</span>
<span class="c">         *</span>
<span class="c">         * @method clickValidator</span>
<span class="c">         * @param {Event} e</span>
<span class="c">         * @private</span>
<span class="c">         */</span>
        <span class="nx">clickValidator</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span><span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">.</span><span class="nx">hidden</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
                <span class="k">return</span> <span class="o">(</span> <span class="k">this</span><span class="o">.</span><span class="nx">isValidHandleChild</span><span class="o">(</span><span class="nx">target</span><span class="o">)</span> <span class="o">&amp;&amp;</span>
                            <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">==</span> <span class="k">this</span><span class="o">.</span><span class="nx">handleElId</span> <span class="o">||</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">DDM</span><span class="o">.</span><span class="nx">handleWasClicked</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">))</span> <span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
    
        <span class="c">/**</span>
<span class="c">         * Handles start drag on the Column resizer.</span>
<span class="c">         *</span>
<span class="c">         * @method startDrag</span>
<span class="c">         * @param e {string} The drag event</span>
<span class="c">         */</span>
        <span class="nx">startDrag</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="c">// Shrinks height of all resizer els to not hold open TH els</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">getColumnSet</span><span class="o">().</span><span class="nx">keys</span><span class="o">,</span>
                <span class="nx">thisKey</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">.</span><span class="nx">getKeyIndex</span><span class="o">(),</span>
                <span class="nx">col</span><span class="o">;</span>
            <span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">col</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">col</span><span class="o">.</span><span class="nx">_ddResizer</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">col</span><span class="o">.</span><span class="nx">_ddResizer</span><span class="o">.</span><span class="nx">handleElId</span><span class="o">).</span><span class="nx">style</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="s2">&quot;1em&quot;</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>

        <span class="c">/**</span>
<span class="c">         * Handles drag events on the Column resizer.</span>
<span class="c">         *</span>
<span class="c">         * @method onDrag</span>
<span class="c">         * @param e {string} The drag event</span>
<span class="c">         */</span>
        <span class="nx">onDrag</span> <span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">newX</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getXY</span><span class="o">(</span><span class="nx">e</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
            <span class="k">if</span><span class="o">(</span><span class="nx">newX</span> <span class="o">&gt;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getX</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">headCellLiner</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">offsetX</span> <span class="o">=</span> <span class="nx">newX</span> <span class="o">-</span> <span class="k">this</span><span class="o">.</span><span class="nx">startX</span><span class="o">;</span>
                <span class="k">var</span> <span class="nx">newWidth</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">startWidth</span> <span class="o">+</span> <span class="nx">offsetX</span> <span class="o">-</span> <span class="k">this</span><span class="o">.</span><span class="nx">nLinerPadding</span><span class="o">;</span>
                <span class="k">if</span><span class="o">(</span><span class="nx">newWidth</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">datatable</span><span class="o">.</span><span class="nx">setColumnWidth</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">column</span><span class="o">,</span> <span class="nx">newWidth</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">});</span>
<span class="o">}</span>

<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c">//</span>
<span class="c">// Deprecated</span>
<span class="c">//</span>
<span class="c">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c"> * @property editorOptions</span>
<span class="c"> * @deprecated Pass configs directly to CellEditor constructor. </span>
<span class="c"> */</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class=""><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class=""><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_carousel.html">carousel</a></li>

                                <li class=""><a href="module_charts.html">charts</a></li>

                                <li class=""><a href="module_colorpicker.html">colorpicker</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_cookie.html">cookie</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class="selected"><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class=""><a href="module_editor.html">editor</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_get.html">get</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_imagecropper.html">imagecropper</a></li>

                                <li class=""><a href="module_imageloader.html">imageloader</a></li>

                                <li class=""><a href="module_json.html">json</a></li>

                                <li class=""><a href="module_layout.html">layout</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_paginator.html">paginator</a></li>

                                <li class=""><a href="module_profiler.html">profiler</a></li>

                                <li class=""><a href="module_profilerviewer.html">profilerviewer</a></li>

                                <li class=""><a href="module_resize.html">resize</a></li>

                                <li class=""><a href="module_selector.html">selector</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class=""><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_uploader.html">uploader</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>

                                <li class=""><a href="module_yuiloader.html">yuiloader</a></li>

                                <li class=""><a href="module_yuitest.html">yuitest</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.util.Chain.html">YAHOO.util.Chain</a></li>
                                <li class=""><a href="YAHOO.util.ColumnDD.html">YAHOO.util.ColumnDD</a></li>
                                <li class=""><a href="YAHOO.util.ColumnResizer.html">YAHOO.util.ColumnResizer</a></li>
                                <li class=""><a href="YAHOO.util.Sort.html">YAHOO.util.Sort</a></li>
                                <li class=""><a href="YAHOO.widget.BaseCellEditor.html">YAHOO.widget.BaseCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.CellEditor.html">YAHOO.widget.CellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.CheckboxCellEditor.html">YAHOO.widget.CheckboxCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.Column.html">YAHOO.widget.Column</a></li>
                                <li class=""><a href="YAHOO.widget.ColumnSet.html">YAHOO.widget.ColumnSet</a></li>
                                <li class=""><a href="YAHOO.widget.DataTable.html">YAHOO.widget.DataTable</a></li>
                                <li class=""><a href="YAHOO.widget.DateCellEditor.html">YAHOO.widget.DateCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.DropdownCellEditor.html">YAHOO.widget.DropdownCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.RadioCellEditor.html">YAHOO.widget.RadioCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.Record.html">YAHOO.widget.Record</a></li>
                                <li class=""><a href="YAHOO.widget.RecordSet.html">YAHOO.widget.RecordSet</a></li>
                                <li class=""><a href="YAHOO.widget.ScrollingDataTable.html">YAHOO.widget.ScrollingDataTable</a></li>
                                <li class=""><a href="YAHOO.widget.TextareaCellEditor.html">YAHOO.widget.TextareaCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.TextboxCellEditor.html">YAHOO.widget.TextboxCellEditor</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="CellEditor.js.html">CellEditor.js</a></li>
                                <li class=""><a href="Chain.js.html">Chain.js</a></li>
                                <li class="selected"><a href="ColumnSet.js.html">ColumnSet.js</a></li>
                                <li class=""><a href="DataTable.js.html">DataTable.js</a></li>
                                <li class=""><a href="RecordSet.js.html">RecordSet.js</a></li>
                                <li class=""><a href="ScrollingDataTable.js.html">ScrollingDataTable.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2008 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
